Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add GitHub Actions. #33

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Oct 25, 2022

This pull-request is an proposal to add GitHub Actions CI (Continous Integration). When the CI (Continous Integration) is enabled for this repository, it is much easy for people to contribute by sending pull-requests. And you can check it easier.

The pull request is working in progress (WIP).

The logic is to use the Docker container, replace the MItoHiFi source from the one installed in the Docker container with the target commit or pull-request's source, and test it. There are 2 test cases, test with small reads file, and configs file. These are tested at #30 .

The reads FASTA test data ilDeiPorc1.reads.small.fa that I added in this pull request is not real data, but what I picked up the first 20045 lines from the real data file ilDeiPorc1.reads.fa. Because currently the entire process with the real data ilDeiPorc1.reads.fa took around 75 minutes. It's too long as a total running time in CI.

$ wc -l ilDeiPorc1.reads.fa ilDeiPorc1.reads.small.fa
  244682 ilDeiPorc1.reads.fa
   20045 ilDeiPorc1.reads.small.fa
  264727 total

I confirmed the MItoHifi stable version in the container passed and worked with the reads FASTA file ilDeiPorc1.reads.small.fa at #30 (comment) . So, I think the test cases with the test data file is still better than no tests.

There is one problem that I can not solve around the fetch.py get_num_seqs method. The method expects the *.trnas files exist in the current working directory. But I don't see the files. See the debug log in the `fetch.py.

For the error in CI, I assume there is a specific logic in the MitoHifi master branch from the latest stable version or a specific logic to install MitoHifi to set in the container.

@jgnunes What do you think about adding the GitHub Actions CI?
Do you know what's wrong? Here is the CI log.
https://github.com/marcelauliano/MitoHiFi/actions/runs/3324184394/jobs/5495438314#step:7:45

$ python ../mitohifi.py -r ./ilDeiPorc1.reads.small.fa -f ./MW539688.1.fasta -g ./MW539688.1.gb -t "$(nproc --all)" -o 2
...
Traceback (most recent call last):
  File "../mitohifi.py", line 380, in <module>
    main()
  File "../mitohifi.py", line 266, in main
    tRNA_ref = fetch.get_ref_tRNA() 
  File "/__w/MitoHiFi/MitoHiFi/fetch.py", line 42, in get_ref_tRNA
    reference_tRNA = max(tRNAs, key=tRNAs.get)
ValueError: max() arg is an empty sequence

MitoHiFi/fetch.py

Lines 19 to 41 in c225acb

def get_ref_tRNA():
"""Defines the reference tRNA to be used for rotating contigs.
Returns:
str: reference tRNA
"""
tRNAs = {}
for curr_file in os.listdir('.'):
if curr_file.endswith('.trnas'):
with open(curr_file, "r") as infile:
for line in infile:
tRNA = line.split("\t")[0]
if tRNA not in tRNAs:
tRNAs[tRNA] = 1
else:
tRNAs[tRNA] += 1
# if any contig has a tRNA-Phe, use it as the reference gene for rotation
if 'tRNA-Phe' in tRNAs:
reference_tRNA = 'tRNA-Phe'
else:
reference_tRNA = max(tRNAs, key=tRNAs.get)
return reference_tRNA

Note I modified the fetch.py temporarily to show the debug log in this CI result. But I will remove the modification eventually by rebasing the commit.

Examples

For the GitHub Actions CI, I introduce other project cases.

@junaruga junaruga changed the title Add GitHub Actions. WIP: Add GitHub Actions. Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant